package com.base.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.base.mapper.voipmapper.HelpersMapper;
import com.base.po.voip.Helpers;
import com.base.service.HelpersService;
import com.base.utils.Page;
import com.base.utils.Produce;
import org.springframework.stereotype.Service;

@Service("helpersService")
public class HelpersServiceImpl implements HelpersService {
	@Autowired
	private HelpersMapper helpersMapper;

	@Override
	public int deleteByPrimaryKey(String id) {
		if (id == null) {
			return 0;
		}
		return helpersMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(String agentid, String title, String content, String pic, Boolean datastatus) {
		Helpers record = new Helpers(Produce.getUUID(), agentid, Produce.getNowDate(), title, content, pic, datastatus);
		return helpersMapper.insert(record);
	}

	@Override
	public int insertSelective(Helpers record) {
		return helpersMapper.insertSelective(record);
	}

	@Override
	public Helpers selectByPrimaryKey(String id) {
		if (id == null) {
			return null;
		}
		return helpersMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Helpers record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return helpersMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Helpers record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return 0;
	}

	@Override
	public int countByAll(Integer status, String agentid, String name) {
		return helpersMapper.countByAll(status, agentid, name);
	}

	@Override
	public List<Helpers> selectByAll(Page page, Integer status, String agentid, String name) {
		return helpersMapper.selectByAll(page, status, agentid, name);
	}
}
